class DeletedTrackable < ActiveRecord::Base
  def restore
    rec = ActiveRecord::Base.const_get(trackable_type).restore_from_xml(record_data, :id => trackable_id)
    rec.id= trackable_id
    return rec if rec && rec.save && self.destroy
    raise "There was an error restoring the #{model} from DeletedRecord(#{id})"
  end
end